#pragma once
#include <src/algorithm/LinearAlgebra/VanDerMonde.h>
#include <src/data/ParticleSet.h>
template <class data>
struct VanDerMonde_example {
	VanDerMonde_example (){
		std::cout << std::endl << "----start VanDerMonde_example---------------------" << std::endl ;
		std::cout << std::endl << "----computing coefficients of a discrete Laplacian delta_{xx} on the grid { 0.1, 0, -0.1 }" << std::endl ;
		std::cout << std::endl << "----that is \frac{1}{h^2}{ u_{i-1} - 2u_i + u_{i+1} }" << std::endl ;
		data x(3);
		x[0] = 0.1;
		x[1] = 0.;
		x[2] = -0.1;
		data beta(3);
		beta[0] = 0.;
		beta[1] = 0.;
		beta[2] = 2.;
		data verify(3);
		verify[0] = 100.;
		verify[1] = -200.;
		verify[2] = 100.;
		data result = VanDerMonde<data>(x,beta); 
		std::cout << " and the winner is " << result;
		bool logical = verify == result;
		std::cout << std::endl << " Verify verify == result :" << std::endl <<  (logical ? "true" : "false") << std::endl;
		OS_DYNAMIC_CHECK(logical == true, "VanDerMonde_example : logical test verify == result failed");

		std::cout << std::endl << "----end VanDerMonde_example---------------------" << std::endl ;
		std::cout << std::endl << "------------------------------------------------" << std::endl;
	}
};

void VanDerMonde_test();
